﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="shop.coffeeshop.master.ShopCoffeeDBBean"%>
<%@ page import="shop.coffeeshop.master.ShopCoffeeDataBean"%>
<%@ page import="java.text.NumberFormat"%>


<jsp:include page="header.jsp"/>

<jsp:include page="aside_sell.jsp"/> 
<body>
<article>
	<h3>새로나온 제품</h3>

	<%
		ShopCoffeeDataBean coffeeLists[] = null;
		int number = 0;
		String coffee_kindName = "";

		ShopCoffeeDBBean coffeeProcess = ShopCoffeeDBBean.getInstance();
		for (int i = 1; i <= 3; i++) {
			coffeeLists = coffeeProcess.getCoffee(i + "00", 3);

			if (coffeeLists[0].getCoffee_kind().equals("100")) {
				coffee_kindName = "원두";
			} else if (coffeeLists[0].getCoffee_kind().equals("200")) {
				coffee_kindName = "텀블러";
			} else if (coffeeLists[0].getCoffee_kind().equals("300")) {
				coffee_kindName = "기타";
			}
	%>

	<br>
	<font size="+1"><b><%=coffee_kindName%> <a
			href="list.jsp?coffee_kind=<%=coffeeLists[0].getCoffee_kind()%>">>더보기</a>
	</b></font>

	<%
		for (int j = 0; j < 1; j++) {
	%>

	<table>
		<tr height="30">
			<td rowspan="4" width="100"><a
				href="coffeeContent.jsp?coffee_id=<%=coffeeLists[j].getCoffee_id()%>&coffee_kind=<%=coffeeLists[0].getCoffee_kind()%>">
					<img src="../../imageFile/<%=coffeeLists[j].getCoffee_image()%>"
					border="0" width="60" height="90">
			</a></td>
			<td width="350"><font size="+1"><b> <a
						href="coffeeContent.jsp?coffee_id=<%=coffeeLists[j].getCoffee_id()%>&coffee_kind=<%=coffeeLists[0].getCoffee_kind()%>">
							<%=coffeeLists[j].getCoffee_title()%></a></b></font></td>
			<td rowspan="4" width="100">
				
				<%
					if (coffeeLists[j].getCoffee_count() == 0) {
				%> <b>일시품절</b> 
<%
 	} else {
 %> 
 &nbsp; 
 
 <%
 	}
 %>
			</td>
		</tr>
		<tr height="30">
			<td width="350">제조사 : <%=coffeeLists[j].getPublishing_com()%></td>
		</tr>
		<tr height="30">
			<td width="350">원산지 : <%=coffeeLists[j].getAuthor()%></td>
		</tr>
		<tr height="30" >
			<td width="350">정가 :<%=NumberFormat.getInstance()
			.format(coffeeLists[j].getCoffee_price())%>원<br> 판매가 : <b><font
					color="red"> <%=NumberFormat	.getInstance()
							.format((int) (coffeeLists[j].getCoffee_price() * ((double) (100 - coffeeLists[j]
									.getDiscount_rate()) / 100)))%>
				</font></b>원
			</td>
		</tr>
	</table>
	<br>
	
	<%
		}
		}
	%>
</article>
</body>
<jsp:include page="footer.jsp"/>